package com.fuxi.cloud.dyndb.vo;

import com.fuxi.cloud.common.util.DesUtils;
import com.fuxi.cloud.desreport.entity.JmReportDataSource;
import org.springframework.beans.BeanUtils;

/**
 * JmreportDynamicDataSourceVo
 *
 * @Author: 扫地僧
 * @CreateTime: 2021-05-03
 */

public class JmreportDynamicDataSourceVo {
    private String id;
    private String code;
    private String dbType;
    private String dbDriver;
    private String dbUrl;
    private String dbName;
    private String dbUsername;
    private String dbPassword;

    public JmreportDynamicDataSourceVo() {
    }

    public JmreportDynamicDataSourceVo(JmReportDataSource dbSource) {
        if (dbSource != null) {
            String var2 = dbSource.getDbPassword();
            if (var2.startsWith("@JimuReport")) {
                dbSource.setDbPassword(DesUtils.encode(dbSource.getDbPassword().replace("@JimuReport", "")));
            }

            BeanUtils.copyProperties(dbSource, this);
        }

    }

    public String getId() {
        return this.id;
    }

    public String getCode() {
        return this.code;
    }

    public String getDbType() {
        return this.dbType;
    }

    public String getDbDriver() {
        return this.dbDriver;
    }

    public String getDbUrl() {
        return this.dbUrl;
    }

    public String getDbName() {
        return this.dbName;
    }

    public String getDbUsername() {
        return this.dbUsername;
    }

    public String getDbPassword() {
        return this.dbPassword;
    }

    public void setId(String id) {
        this.id = id;
    }

    public void setCode(String code) {
        this.code = code;
    }

    public void setDbType(String dbType) {
        this.dbType = dbType;
    }

    public void setDbDriver(String dbDriver) {
        this.dbDriver = dbDriver;
    }

    public void setDbUrl(String dbUrl) {
        this.dbUrl = dbUrl;
    }

    public void setDbName(String dbName) {
        this.dbName = dbName;
    }

    public void setDbUsername(String dbUsername) {
        this.dbUsername = dbUsername;
    }

    public void setDbPassword(String dbPassword) {
        this.dbPassword = dbPassword;
    }

    @Override
    public boolean equals(Object o) {
        if (o == this) {
            return true;
        } else if (!(o instanceof JmreportDynamicDataSourceVo)) {
            return false;
        } else {
            JmreportDynamicDataSourceVo var2 = (JmreportDynamicDataSourceVo)o;
            if (!var2.canEqual(this)) {
                return false;
            } else {
                label107: {
                    String var3 = this.getId();
                    String var4 = var2.getId();
                    if (var3 == null) {
                        if (var4 == null) {
                            break label107;
                        }
                    } else if (var3.equals(var4)) {
                        break label107;
                    }

                    return false;
                }

                String var5 = this.getCode();
                String var6 = var2.getCode();
                if (var5 == null) {
                    if (var6 != null) {
                        return false;
                    }
                } else if (!var5.equals(var6)) {
                    return false;
                }

                String var7 = this.getDbType();
                String var8 = var2.getDbType();
                if (var7 == null) {
                    if (var8 != null) {
                        return false;
                    }
                } else if (!var7.equals(var8)) {
                    return false;
                }

                label86: {
                    String var9 = this.getDbDriver();
                    String var10 = var2.getDbDriver();
                    if (var9 == null) {
                        if (var10 == null) {
                            break label86;
                        }
                    } else if (var9.equals(var10)) {
                        break label86;
                    }

                    return false;
                }

                label79: {
                    String var11 = this.getDbUrl();
                    String var12 = var2.getDbUrl();
                    if (var11 == null) {
                        if (var12 == null) {
                            break label79;
                        }
                    } else if (var11.equals(var12)) {
                        break label79;
                    }

                    return false;
                }

                label72: {
                    String var13 = this.getDbName();
                    String var14 = var2.getDbName();
                    if (var13 == null) {
                        if (var14 == null) {
                            break label72;
                        }
                    } else if (var13.equals(var14)) {
                        break label72;
                    }

                    return false;
                }

                String var15 = this.getDbUsername();
                String var16 = var2.getDbUsername();
                if (var15 == null) {
                    if (var16 != null) {
                        return false;
                    }
                } else if (!var15.equals(var16)) {
                    return false;
                }

                String var17 = this.getDbPassword();
                String var18 = var2.getDbPassword();
                if (var17 == null) {
                    if (var18 != null) {
                        return false;
                    }
                } else if (!var17.equals(var18)) {
                    return false;
                }

                return true;
            }
        }
    }

    protected boolean canEqual(Object other) {
        return other instanceof JmreportDynamicDataSourceVo;
    }

    @Override
    public int hashCode() {
        boolean var1 = true;
        byte var2 = 1;
        String var3 = this.getId();
        int var11 = var2 * 59 + (var3 == null ? 43 : var3.hashCode());
        String var4 = this.getCode();
        var11 = var11 * 59 + (var4 == null ? 43 : var4.hashCode());
        String var5 = this.getDbType();
        var11 = var11 * 59 + (var5 == null ? 43 : var5.hashCode());
        String var6 = this.getDbDriver();
        var11 = var11 * 59 + (var6 == null ? 43 : var6.hashCode());
        String var7 = this.getDbUrl();
        var11 = var11 * 59 + (var7 == null ? 43 : var7.hashCode());
        String var8 = this.getDbName();
        var11 = var11 * 59 + (var8 == null ? 43 : var8.hashCode());
        String var9 = this.getDbUsername();
        var11 = var11 * 59 + (var9 == null ? 43 : var9.hashCode());
        String var10 = this.getDbPassword();
        var11 = var11 * 59 + (var10 == null ? 43 : var10.hashCode());
        return var11;
    }

    @Override
    public String toString() {
        return "JmreportDynamicDataSourceVo(id=" + this.getId() + ", code=" + this.getCode() + ", dbType=" + this.getDbType() + ", dbDriver=" + this.getDbDriver() + ", dbUrl=" + this.getDbUrl() + ", dbName=" + this.getDbName() + ", dbUsername=" + this.getDbUsername() + ", dbPassword=" + this.getDbPassword() + ")";
    }
}

